Skip to content

Conversation

@Bitshifter-9
Copy link

Title: feat(transformers): add transformerRemoveComments

Description

This PR introduces a new transformer [transformerRemoveComments]
This transformer allows users to automatically remove comments from their code snippets. This is particularly useful for scenarios like presentation slides or minimal examples where comments might be distracting or consume valuable vertical space.

It uses includeExplanation: true to identify tokens with comment scopes (e.g., comment.line, comment.block) and filters them out. It also includes an option removeEmptyLines (defaulting to true) to clean up lines that become empty after comment removal.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@netlify
Copy link

netlify bot commented Nov 26, 2025

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit f064268
🔍 Latest deploy log https://app.netlify.com/projects/shiki-next/deploys/6927393fe13d6c0008d3be41
😎 Deploy Preview https://deploy-preview-1144--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 26, 2025

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit f064268
🔍 Latest deploy log https://app.netlify.com/projects/shiki-matsu/deploys/6927393f2750330008301713
😎 Deploy Preview https://deploy-preview-1144--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Bitshifter-9
Copy link
Author

@antfu Raised PR Please take a look review and merge it ☺️

@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.98%. Comparing base (b86d6bf) to head (f064268).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1144      +/-   ##
==========================================
+ Coverage   94.95%   94.98%   +0.02%     
==========================================
  Files          90       91       +1     
  Lines        7776     7811      +35     
  Branches     1632     1645      +13     
==========================================
+ Hits         7384     7419      +35     
  Misses        386      386              
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Bitshifter-9
Copy link
Author

@antfu All chechks have passed
please take a review at the PR ☺️

@Bitshifter-9
Copy link
Author

@antfu Please Update if any Changes are required on this this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants